{// 引入标签库 }
<tagLib name="fanwe" />
{// 加载头部公共文件 }
<include file="Public:header" />
<!-- 菜单区域  -->
<script>
	function showOrder(id){
		window.open(APP+"?m=Order&a=show&id=" + id);
	}
	function export_lottery()
	{
		var sn = document.getElementById("c_sn").value;
		var user_name = document.getElementById("c_user_name").value;
		var goods_id = document.getElementById("c_goods_id").value;
		var pname = document.getElementById("c_pname").value;
		var url = APP+'?m=Lottery&a=exportcsv&sn='+sn+'&user_name='+user_name+'&goods_id='+goods_id+'&pname='+pname;
		location.href = url;
	}
</script>
<!-- 主页面开始 -->
<div id="main" class="main" >

<!-- 主体内容  -->
<div class="content" >
<div class="title">{$Think.lang.DATA_LIST}</div>
<!--  功能操作区域  -->
<form method='post' action="{:u($module_name.'/index')}">
<div class="operate" >
<fanwe:imageBtn name="add" value="{$Think.lang._ADD_DATA}" click="addData2({$goods_id})" style="impBtn hMargin fLeft shadow" />
<fanwe:imageBtn name="edit" value="{$Think.lang._EDIT_DATA}" click="editData()" style="impBtn hMargin fLeft shadow" />
<fanwe:imageBtn name="delete" value="{$Think.lang._DELETE_DATA}" click="foreverdel()" style="impBtn hMargin fLeft shadow" />
<input type="button" id="" name="export" value="导出csv" class="add imgButton" onclick="export_lottery()">
<!-- 查询区域 -->

商品ID：<input type="text" id="c_goods_id" name="goods_id" value="{$goods_id}" class="medium" style="width:50px" >
抽奖券:<input type="text" id="c_sn" name="sn" value="{$sn}" class="medium" style="width:90px" >
会员名:<input type="text" id="c_user_name" name="user_name" value="{$user_name}" class="medium" style="width:90px" >
邀请人:<input type="text" id="c_pname" name="pname" value="{$pname}" class="medium" style="width:90px" >
<fanwe:imageBtn type="submit" name="search" value="{$Think.lang._SEARCH_DATA}" style="impBtn hMargin fLeft shadow" />


</div>
<!-- 高级查询区域 -->

</form>
<php>
function getOrderSn($id){
	$sn = M("Order")->where("id=".$id)->getField('sn');
	return "<a href='javascript:showOrder(".$id.");'>".$sn."</a>";
}
</php>
<!-- 功能操作区域结束 -->

<!-- 列表显示区域  -->
<div class="list" >
<fanwe:list 
	id="checkList" 
	name="lottery" 
	style="list" 
	checkbox="true" 
	action="true" 
	datasource="list" 
	child="true" 
	show="id:{$Think.lang.ID}|6%,goods_id:商品ID,goods_id|getGoodsNameNoHref=$lottery['goods_id']:商品名称,sn:抽奖券,user_name:会员名,mobile_phone:电话,email:电子邮件,pname:邀请人,invite_time|toDate:邀请时间,order_id|getOrderSn=$lottery['order_id']:订单号"
	actionlist="edit:{$Think.lang._EDIT_DATA}:id,foreverdel:{$Think.lang._DELETE_DATA}:id" /> 
</div>
<!--  分页显示区域 -->
<div class="page">{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>
<!-- 主页面结束 -->
<script type="text/javascript">
function addData2(id)
{
	location.href='admin.php?m=Lottery&a=add&goods_id=' + id;
}
</script>
